package com.wx.controller.interfaceTestController;

import com.wx.entity.CollectDetailModel;
import com.wx.entity.CollectUserProductDetailModel;
import com.wx.mapper.*;
import com.wx.pojo.*;
import com.wx.service.*;
import com.wx.utils.JsonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import static com.wx.utils.commonUtil.generateOrderNo;

@RestController
@RequestMapping("tf")
public class InterfaceTestController {

    @Autowired
    private IUserService iUserService;
    @Autowired
    private ICollectService iCollectService;
    @Autowired
    private IUserProductDetailService iUserProductDetailService;
    @Autowired
    private ICollectUserDetailService iCollectUserDetailService;
    @Autowired
    private ICollectProductDetailService iCollectProductDetailService;
    @Autowired
    private IProductService iProductService;
    @Autowired
    private WxOrderMapper wxOrderMapper;


    @GetMapping("list")
    private JSONResult listUser(){

        return JSONResult.ok(iUserProductDetailService.getModelDetail("101547722416395",3));

//        return JSONResult.ok(iUserProductDetailService.participateModel(3,"101547722416395"));
//        return JSONResult.ok(iUserProductDetailService.listModelJoinUser("101547722416395"));
//        return JSONResult.ok(wxProductMapper.selectByPrimaryKey(2));
//        return JSONResult.ok(iUserService.getUserByLogin("admin","123"));
//        return JSONResult.ok(iUserService.getUserByUsername("admin"));
    }

    @GetMapping("listCollectUserDetail")
    private JSONResult listCollectUserDetail(){
//        return JSONResult.ok(iCollectUserDetailService.listModel());
//        return JSONResult.ok(iCollectUserDetailService.listModelByNumber("101547722416395"));
//        return JSONResult.ok(iCollectUserDetailService.listModelByUserId(new Integer(3)));

        return JSONResult.ok(iCollectUserDetailService.listModelByNumberAndUser(3,"101547722416395"));

    }




}
